package ru.gerunn.hibernate.tables;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(schema = "logstest")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Log {

	@Id
	@GeneratedValue
	private long id;
	@ManyToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "operationId")
	private Operation operation;
	private long duration;
	private Timestamp executed;
	private String params;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Operation getOperation() {
		return operation;
	}

	public void setOperation(Operation operation) {
		this.operation = operation;
	}

	public long getDuration() {
		return duration;
	}

	public void setDuration(long duration) {
		this.duration = duration;
	}

	public Timestamp getExecuted() {
		return executed;
	}

	public void setExecuted(Timestamp executed) {
		this.executed = executed;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

}
